#pragma once


// CVerticalScrollbar

class CVerticalScrollbar : public CStatic
{
	DECLARE_DYNAMIC(CVerticalScrollbar)

public:
	CListCtrl*		m_pList;

private:
	BOOL			m_bMouseDownArrowUp;
	BOOL			m_bMouseDownArrowDown;
	BOOL			m_bDragging;
	BOOL			m_bMouseDown;

	int				m_nThumbTop;
	double			m_dbThumbInterval;

	int				m_nSpanTop;
	int				m_nSpanBottom;
	int				m_nThumbHeight;

public:
	void LimitThumbPosition();
	void Draw();
	void UpdateThumbPosition();
	void UpdateThumbPosition(BOOL bCheckMouseMove);
	void ScrollDown();
	void ScrollUp();
	void PageUp();
	void PageDown();

	void SetMouseWheel(int nVal);

public:
	CVerticalScrollbar();
	virtual ~CVerticalScrollbar();

public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
protected:
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnPaint();
	afx_msg void OnTimer(UINT nIDEvent);
	DECLARE_MESSAGE_MAP()
};


